Computers and other systems have used disk drives for many years to store digital information. This is because while computers and other systems may have sufficient host memory (such as random access memory) to perform ongoing computational tasks, storing large amounts of data, be it an operating system, application programs, or program data, is impractical using anything except a mass storage device such as a disk drive.
FIG. 1 illustrates a typical prior art computer system 100 that includes a main memory 102 for storing programs and data used by a processor 104. The system 100 further includes auxiliary systems that are generically shown as a chipset 106. The chipset 106 includes a disk controller 108 that controls data storage and data integration in the main memory 102 and in a disk drive 110. The disk drive 110 includes drive electronics 112 having a buffer memory 114. Typically, the buffer memory 114 is a dynamic random access memory (DRAM) of 2 MB-8 MB. Data is passed between the host controller 108 and the drive electronics 112 via a bi-directional bus 116. To enable integration of the various components of the system 100, that system operates under the control of an operating system 118.
While there are many types of disk drives, including floppy disks and optical disks, probably the most widely used is the hard disk drive. A hard disk drive can record massive amounts of digital information on concentric memory tracks of a magnetic medium that coats one or more disks. The digital information is recorded as magnetic transitions within the magnetic medium. The disks are mounted on a spindle and turned at very high speeds by a spindle motor. Information on the disks is accessed using magnetic read/write heads located on pivoting arms that move the read/write heads over the disks.
Hard disk drives require more than just mechanical components. Modern hard disk drives have sophisticated drive electronics 112 that include an interface for receiving and transmitted signals and data from and to external devices such as the host controller 108, and a Head Disk Assembly Interface (not shown) for interfacing the drive electronics 112 to a head disk assembly (not shown). The head disk assembly includes the disks, the read/write head(s), the spindle motor that rotates the disks, a servo-operated actuator arm that moves the read/write head(s), and other disk drive components. The drive electronics 112 also include servo drivers to move the actuator arms, motor drivers to drive the spindle motor, write drivers to drive the read/write head(s) to write data, an amplifier to amplify data being read, logic to determine where particular data is to be written to or read from, and data formatting electronics to convert incoming data to the proper format for writing and for converting outgoing data to the proper format for the external system. Generally, the drive electronics 112 operate under the control of a processor.
To enable higher speeds and improved performance, modern drive electronics include the buffer memory 114 (RAM) for temporary storing data. For example, data to be written may be temporarily stored in buffer memory 114 until the read/write head(s) are moved to the correct write location(s). Additionally, data that has been read may be stored until data integrity checks have been performed to ensure that the read data is not corrupted. Data may also be temporarily stored in buffer memory 114 until sufficient data is available for efficient transmission, or until an external device calls for the data.
Some prior art disk systems incorporate data prefetching. That is, temporarily storing data for subsequent use in such a manner that disk operations as measured by disk benchmark tests appear faster. For example, in read prefetch, requested data is read and then data at a subsequent location or locations (sectors) of the disk is obtained and temporarily stored for future use. The reason for doing this is that if data at one location is read, the next read is likely to be for data at the next location (because, if possible, data is stored sequentially). By obtaining data at the adjacent locations before it is actually requested, overall read operations can be speed up, improving benchmark performance. If the prefetched data is not asked for, it can be discarded. Write prefetching is similar: data that is to be written onto a disk can be temporarily stored in the buffer memory 114 until the read/write heads are in position to write data. In fact, writing data can be delayed while read operations are being performed. The overall system believes that the writes have been performed when they are only stored. Then, when time is available, the data can be written without slowing the system at all. Read and write prefetching, particularly in combination can dramatically improve disk benchmark results.
High performance computing can use command queuing, which is schematically illustrated in FIG. 2, to implement multiple read requests. As shown, a host controller 202 creates a disk operations list 203 of data that it wants read from and/or written to a disk 204. FIG. 2 shows that list being comprised of three disk operations, designated as tag 0, tag 7, and tag 31, where each tag represents a different data request. In practice, that list 203 can have 32, 64, or more tags. The disk operations list 203 is sent to disk electronics 206 that accepts the disk operations list 203 and begins processing its read and write requests by issuing various commands to read data or to obtain data from the host controller for writing.
An extension of command queuing is out-of-order processing, which is also schematically illustrated in FIG. 2. In out-of-order processing, the disk electronics 206 re-orders the disk operations list 203 and issues a set of commands 208 that do not necessarily follow the order of the disk operations list 203. In fact, the disk electronics 206 orders read and write operations as required to improve disk operations. That is, if a read/write head is in position to read a tag request, the disk electronics causes the data request associated with that tag to be read. Furthermore, the disk electronics can obtain all data that is to be written from the host memory and then store that data in a disk buffer memory. Subsequently, when time is available, that stored data can be written, beneficially after all read operations have been performed. Usually, but not always, requests to obtain write data are sent to the host controller in the order in which they are provided in the disk operations list 203. When the requests are not made in the order found in the disk operations list 203, the disk electronics is said to process write requests out-of-order.
It is possible to save some write data access if the write requests are performed as provided in the disk operations list 203. Since the host controller makes the disk operations list 203, it is aware which write request comes first. The host controller can simply obtain and buffer the first write request in the disk operations list 203. Then, when the disk electronics asks for the data it is immediately available. However, this host controller speculative prefetch is detrimental in out-of-order processing since time is wasted in speculative prefetching.
Prefetching, command queuing, and out-of-order processing have all proven useful. However, such operations are not without their problems. For example, given that write prefetching involves temporarily storing data in a disk buffer memory before actually writing to a disk, if a power failure or some other unusual operation occurs the temporarily stored write data can be lost. Since the host system understands that the data it sent has been written to disk, no protection for that data exists. In that case, the data is permanently lost. Such data loss can be disastrous in critical applications such as those that occur in financial, medical, and military systems. In such systems processing write requests by temporarily storing data in disk buffer memory should not be performed. If not performed, speculatively prefetching will not be helpful since the first write request in the data list is not more likely to be the first requested than any other write request.
Therefore a method and apparatus the selectively uses speculative write prefetching when that technique is useful would be beneficial.